
<%@ page import="ceramicasoledade.Veiculo"%>
<!doctype html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'veiculo.label', default: 'Veiculo')}" />
<title><g:message code="default.show.label" args="[entityName]" /></title>
</head>
<body>
	<a href="#show-veiculo" class="skip" tabindex="-1"><g:message
			code="default.link.skip.label" default="Skip to content&hellip;" /></a>
	<div class="nav" role="navigation">
		<ul>
			<li><a class="home" href="${createLink(uri: '/')}"><g:message
						code="default.home.label" /></a></li>
			<li><g:link class="list" action="list">
					<g:message code="default.list.label" args="[entityName]" />
				</g:link></li>
			<li><g:link class="create" action="create">
					<g:message code="default.new.label" args="[entityName]" />
				</g:link></li>
		</ul>
	</div>
	<div id="show-veiculo" class="content scaffold-show" role="main">
		<h1>
			<g:message code="default.show.label" args="[entityName]" />
		</h1>
		<g:if test="${flash.message}">
			<div class="message" role="status">
				${flash.message}
			</div>
		</g:if>
		<ol class="property-list veiculo">

			<g:if test="${veiculoInstance?.cor}">
				<li class="fieldcontain"><span id="cor-label"
					class="property-label"><g:message code="veiculo.cor.label"
							default="Cor" /></span> <span class="property-value"
					aria-labelledby="cor-label"><g:fieldValue
							bean="${veiculoInstance}" field="cor" /></span></li>
			</g:if>


			<g:if test="${veiculoInstance?.modelo}">
				<li class="fieldcontain"><span id="modelo-label"
					class="property-label"><g:message
							code="veiculo.modelo.label" default="Modelo" /></span> <span
					class="property-value" aria-labelledby="modelo-label"><g:fieldValue
							bean="${veiculoInstance}" field="modelo" /></span></li>
			</g:if>

			<g:if test="${veiculoInstance?.motorista}">
				<li class="fieldcontain"><span id="motorista-label"
					class="property-label"><g:message
							code="veiculo.motorista.label" default="Motorista" /></span> <span
					class="property-value" aria-labelledby="motorista-label"><g:link
							controller="motorista" action="show"
							id="${veiculoInstance?.motorista?.id}">
							${veiculoInstance?.motorista?.encodeAsHTML()}
						</g:link></span></li>
			</g:if>

			<g:if test="${veiculoInstance?.placa}">
				<li class="fieldcontain"><span id="placa-label"
					class="property-label"><g:message code="veiculo.placa.label"
							default="Placa" /></span> <span class="property-value"
					aria-labelledby="placa-label"><g:fieldValue
							bean="${veiculoInstance}" field="placa" /></span></li>
			</g:if>

		</ol>
		<g:form>
			<fieldset class="buttons">
				<g:hiddenField name="id" value="${veiculoInstance?.id}" />
				<g:link class="edit" action="edit" id="${veiculoInstance?.id}">
					<g:message code="default.button.edit.label" default="Edit" />
				</g:link>
				<g:actionSubmit class="delete" action="delete"
					value="${message(code: 'default.button.delete.label', default: 'Delete')}"
					onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
			</fieldset>
		</g:form>
	</div>
	<div>
		<g:if test="${veiculoInstance?.lenhas}">
			<li class="fieldcontain"><span id="lenhas-label"
				class="property-label"><g:message code="veiculo.lenhas.label"
						default="Lenhas" /></span>

				<table>
					<thead>
						<tr>

							<g:sortableColumn property="metragem"
								title="${message(code: 'lenha.metragem.label', default: 'Metragem')}" />

							<g:sortableColumn property="valor"
								title="${message(code: 'lenha.valor.label', default: 'Valor')}" />

							<g:sortableColumn property="data"
								title="${message(code: 'lenha.data.label', default: 'Data')}" />


						</tr>
					</thead>
					<tbody>
						<g:each in="${veiculoInstance.lenhas}" var="l">
							<tr>

								<td><g:link action="show" id="${l.id}">
										${l.metragem}
									</g:link></td>

								<td>
									${l.valor}
								</td>

								<td><g:formatDate format="dd/MM/yyyy" date="${l.data}" /></td>

							</tr>
						</g:each>
					</tbody>
				</table></li>
		</g:if>

		</br>

		<g:if test="${veiculoInstance?.entregas}">
			<li class="fieldcontain"><span id="entregas-label"
				class="property-label"><g:message
						code="veiculo.entregas.label" default="Entregas" /></span></li>

			<table>
				<thead>
					<tr>

						<th><g:message code="pedido.cliente.label" default="Cliente" /></th>

						<g:sortableColumn property="dataEntrega"
							title="${message(code: 'pedido.dataEntrega.label', default: 'Data Entrega')}" />

						<g:sortableColumn property="local"
							title="${message(code: 'pedido.local.label', default: 'Local')}" />

						<g:sortableColumn property="notaFiscal"
							title="${message(code: 'pedido.notaFiscal.label', default: 'Nota Fiscal')}" />

						<g:sortableColumn property="pago"
							title="${message(code: 'pedido.pago.label', default: 'Pago')}" />

						<th><g:message code="pedido.produto.label" default="Produto" /></th>

					</tr>
				</thead>
				<tbody>
					<g:each in="${veiculoInstance.entregas}" var="e">
						<tr>

							<td><g:link action="show" id="${e.id}">
									${e.cliente}
								</g:link></td>

							<td><g:formatDate date="${e.dataEntrega}" /></td>

							<td>
								${e.local}
							</td>

							<td>
								${e.notaFiscal}
							</td>

							<td><g:formatBoolean boolean="${e.pago}" /></td>

							<td>
								${e.produto}
							</td>

						</tr>
					</g:each>
				</tbody>
			</table>
		</g:if>

	</div>

</body>
</html>
